﻿using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using Facebook;
using FacebookAcessLibrary.Interfaces;


namespace FacebookAcessLibrary.FacebookClass
{
    public class ProfileFacebook : IProfile
    {
        private FacebookClient _client = new FacebookClient("141208535946866", "378a4f4d0672dd55c7a21ab9362544df");
       
        public string Name
        { get; set; }

        public string Address
        { get; set; }

        public DateTime Birthday { get; set; }


        public void GetProfile(string token)
        {
            
            _client.AccessToken = token;
            dynamic parameters = new ExpandoObject();
            parameters.fields = "name,location,birthday";
            dynamic response = _client.Get("me", parameters);
            string id = response.id;
            Name = response.name;
            Address = response.location.name;
        }
    }
}
